package com.kelaite.procurement.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import com.fasterxml.jackson.annotation.JsonIgnore;

// Generated 2016-3-6 15:13:23 by Hibernate Tools 3.4.0.CR1

/**
 * TProvince generated by hbm2java
 */
@Entity(name = "t_province")
public class TProvince extends TBaseEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;
	@Column(name = "province_name", length=160, nullable=false)
	private String provinceName;
	@Column(name = "description", length=160)
	private String description;

	@OneToMany(mappedBy = "tProvince", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@OrderBy(value = "id ASC")
	@JsonIgnore
	private Set<TCity> tCities = new HashSet<TCity>();

	public TProvince() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getProvinceName() {
		return provinceName;
	}

	public void setProvinceName(String provinceName) {
		this.provinceName = provinceName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<TCity> gettCities() {
		return tCities;
	}

	public void settCities(Set<TCity> tCities) {
		this.tCities = tCities;
	}

}
